﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Model;
using Manager;
using Manager.CustomerHelper;
namespace HealthSystem.sysAdmin
{
    public partial class Notice_New : BasePage
    {
        HW_NoticeManager noticeManager = new HW_NoticeManager();
        public override ModuleType Module
        {
            get
            {
                return ModuleType.OrgManager;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                btnClose.OnClientClick += ExtAspNet.ActiveWindow.GetHidePostBackReference();
            }
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            HW_Notice notice = new HW_Notice();
            notice.NoticeTiltle = txtTitle.Text;
            notice.NoticeContent = txtContent.Text;
            //notice.StartDate = txtStartDate.SelectedDate;
            //notice.EndDate = txtEndDate.SelectedDate;
            notice.StartDate = DateTime.Now;
            notice.EndDate = DateTime.Now;
            notice.CreateDate = DateTime.Now;
            notice.Statute = false;
            try
            {
                noticeManager.Add(notice);
                ExtAspNet.PageContext.RegisterStartupScript(ExtAspNet.ActiveWindow.GetHidePostBackReference());
            }
            catch
            {
                ExtAspNet.Alert.Show("新增消息失败");
            }
        }
        protected void btnSaveSend_Click(object sender, EventArgs e)
        {
            HW_Notice notice = new HW_Notice();
            notice.NoticeTiltle = txtTitle.Text;
            notice.NoticeContent = txtContent.Text;
            //notice.StartDate = txtStartDate.SelectedDate;
            //notice.EndDate = txtEndDate.SelectedDate;
            notice.StartDate = DateTime.Now;
            notice.EndDate = DateTime.Now;
            notice.CreateDate = DateTime.Now;
            notice.Statute = true;
            try
            {
                noticeManager.Add(notice);
                ExtAspNet.PageContext.RegisterStartupScript(ExtAspNet.ActiveWindow.GetHidePostBackReference());
            }
            catch
            {
                ExtAspNet.Alert.Show("新增消息失败");
            }
        }
    }
}